package io.renren.modules.teacher.service.impl;

import io.renren.modules.student.dao.StuPersonInfoDao;
import io.renren.modules.student.service.StuPersonInfoService;
import io.renren.modules.teacher.dao.TeacherPersonInfoDao;
import io.renren.modules.teacher.service.TeacherPersonInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class TeacherPersonInfoServiceImpl implements TeacherPersonInfoService {
    @Autowired
    private TeacherPersonInfoDao teacherPersonInfoDao;
    /*
    得到基本信息
     */
    @Override
    public Map<String, Object> queryBaseInfo(String param) {
        Map<String, Object> result =teacherPersonInfoDao.queryBaseInfo(param);
        return result;
    }
    /*
    更新基本信息
     */

    @Override
    public void updateBaseInfo(Map<String, Object> formData) {
         //更新teacher表
         teacherPersonInfoDao.updateBaseInfo(formData);
         //更新sys_user表
         teacherPersonInfoDao.updateUser(formData);
    }
  /*
  存头像teacher表和sys_user表
   */
    @Override
    public void saveIcon(Map<String, Object> iconUrl) {
        teacherPersonInfoDao.saveIcon(iconUrl);
        teacherPersonInfoDao.saveIconUser(iconUrl);
    }

}
